using System;
using System.Windows.Input;

namespace CalendarSubscriptionApp
{
    public class CloseTabCommand: ICommand
    {
        public void Execute(object parameter)
        {
            var subscription = parameter as CalendarSubscriptionViewModel;
            if (subscription == null) return;

            subscription.CancelSubscription();
        }

        public bool CanExecute(object parameter)
        {
            return parameter is CalendarSubscriptionViewModel;
        }

        public event EventHandler CanExecuteChanged;
    }
}